#pragma once


#include "Scene/SceneNodeComponent.h"
#include "Render/Scene/CameraParameters.h"
#include "CameraComponent.m.h"


class RViewportWidget;

//viewport is output target of camera component
//camera component will change the viewport's render parameters in tick 
RCLASS()
class WHENGINE_API RCameraComponent:public RSceneNodeComponent 
{
    ROBJECT
public:
    RCameraComponent()=default;
    ~RCameraComponent()=default;

    virtual void OnBeginPlay() override;
    virtual void OnEndPlay() override;

    //width / height
    RFIELD()
    float AspectRatio=1920/1080.f;

    RFIELD()
    float PerspectiveFOVY=45.f;

    RFIELD()
    bool bUseOrthographicProjection=false;

    RFIELD()
    float OrthographicWidth=512.f;

    RFIELD()
    float Near=0.1f;

    RFIELD()
    float Far=100000.f;


    SRawCameraParameters GetViewportParameter();
};